/*******************************************************************************
 * Copyright (c) 2008 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *     Bartosz Michalik (bartosz.michalik@gmail.com)
 *******************************************************************************/
package org.eclipse.pde.internal.ui.editor.product.customization;

import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.pde.core.plugin.IPluginObject;
import org.eclipse.pde.internal.core.iproduct.ICustomizationInfo;
import org.eclipse.pde.internal.core.product.RemoveTransform;

/**
 * @author Bartosz Michalik
 *
 */
public class RemoveFeatureAction extends TransformationAction {

	public RemoveFeatureAction(ICustomizationInfo info, IStructuredSelection selection) {
		super("Remove from configuration", info, selection);
	}

	
	
	public void run() {
		if (fSelection.getFirstElement() instanceof IPluginObject) {
			RemoveTransform transform = new RemoveTransform(fInfo.getModel(), fSelection.getFirstElement());
			fInfo.addTransform(transform);

		}
	}

}
